package com.rao.springbootschoolshop.bean;

/**
 * 错误码统一处理类，所有的错误码统一定义在这里
 */
public class CodeMsg {

    private int code; //错误码
    private String msg; //错误信息

    /**
     * 构造函数私有化即单例模式，这个类的对象只能创建一个
     * @param code
     * @param msg
     */
    private CodeMsg(Integer code ,String msg){
        this.code = code;
        this.msg = msg;
    }
    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    //前后台通用错误码定义
    //处理成功错误码
    public static CodeMsg SUCCESS = new CodeMsg(0,"success");
    //非法数据错误码
    public static CodeMsg DATA_ERROR = new CodeMsg(-1,"非法数据");
    public static CodeMsg CPACHA_EMPTY = new CodeMsg(-2,"验证码不能为空");
    public static CodeMsg VALIDATE_ENTITY_ERROR = new CodeMsg(-3,"字符串长度不足");
    public static CodeMsg SESSION_EXPIRED = new CodeMsg(-4,"连接超时，请重新登录");
    public static CodeMsg CPACHA_ERROR = new CodeMsg(-5,"验证码输入错误");
    public static CodeMsg USER_SESSION_EXPLRED = new CodeMsg(-6,"未登录或会话失效，请重新登录");
    //文件上传错误码
    public static CodeMsg UPLOAD_PHOTO_SUFFIX_ERROR = new CodeMsg(-7,"图片格式错误，请重新上传");
    public static CodeMsg UPLOAD_PHOTO_MAXSIZE_ERROR = new CodeMsg(-8,"图片过大，请重新选择");


    //后台管理类错误码
    //用户管理类错误码
    public static CodeMsg ADMIN_USERNAME_EMPTY = new CodeMsg(-2000,"用户名不能为空");
    public static CodeMsg ADMIN_PASSWORD_EMPTY = new CodeMsg(-2001,"密码不能为空");
    public static CodeMsg ADMIN_USER_ROLE_EMPTY = new CodeMsg(-2002,"请选择用户所属角色");
    public static CodeMsg ADMIN_USER_NAME_EXIST = new CodeMsg(-2003,"该用户名已存在！");
    public static CodeMsg ADMIN_USER_ADD_ERROR = new CodeMsg(-2004,"用户添加失败，请联系管理员");
    public static CodeMsg ADMIN_USER_NO_EXIST = new CodeMsg(-2005,"用户不存在！");
    public static CodeMsg ADMIN_USER_EDIT_ERROR = new CodeMsg(-2006,"用户编辑失败，请联系管理员");
    public static CodeMsg ADMIN_USER_DELETE_ERROR = new CodeMsg(-2007,"该用户存在关联数据，不允许删除");
    public static CodeMsg ADMIN_NO_RIGHT = new CodeMsg(-2008,"你所属的角色，没有该权限！");
    public static CodeMsg ADMIN_USER_OLDPOSSWORD_ERROR = new CodeMsg(-2009,"原始密码不正确，请重新输入！");
    public static CodeMsg ADMIN_USER_SAME_OLDPOSSWORD = new CodeMsg(-2010,"新密码不能与原始密码相同，请修改！");
    public static CodeMsg ADMIN_USER_CONFIRM_PASSWORD_ERROR = new CodeMsg(-2011,"确认密码与新密码不一致，请重新输入！");
    public static CodeMsg ADMIN_USER_PASSWORD_EMPTY = new CodeMsg(-2012,"新密码不能为空！");
    public static CodeMsg ADMIN_USER_PASSWORD_LENGTH_ERROR = new CodeMsg(-2013,"新密码不能为空！");

    //登录类错误码
    public static CodeMsg ADMIN_USER_NOEXIST = new CodeMsg(-3000,"该用户名不存在");
    public static CodeMsg ADMIN_PASSWORD_ERROR = new CodeMsg(-3001,"密码错误");
    public static CodeMsg ADMIN_USER_UNABLE = new CodeMsg(-3002,"该用户已被冻结，请联系管理员");
    public static CodeMsg ADMIN_USER_ROLE_UNABLE = new CodeMsg(-3003,"该用户所属角色状态不可用，请联系管理员");
    public static CodeMsg ADMIN_USER_ROLE_AUTHORITES_EMPTY = new CodeMsg(-3004,"该用户所属角色无可用权限，请联系管理员");

    //后台菜单管理类错误码
    public static CodeMsg ADMIN_MENU_ADD_ERROR = new CodeMsg(-4000,"菜单添加失败，请联系管理员");
    public static CodeMsg ADMIN_MENU_EDIT_ERROR = new CodeMsg(-4001,"菜单编辑失败，请联系管理员");
    public static CodeMsg ADMIN_MENU_ID_EMPTY = new CodeMsg(-4002,"菜单ID不能为空");
    public static CodeMsg ADMIN_MENU_ID_ERROE = new CodeMsg(-4003,"菜单ID错误");
    public static CodeMsg ADMIN_MENU_DELETE_ERROR = new CodeMsg(-4004,"该菜单下有子菜单，请逐级删除");

    //后台角色管理类错误码
    public static CodeMsg ADMIN_ROLE_ADD_ERROR = new CodeMsg(-5000,"角色添加失败，请联系管理员");
    public static CodeMsg ADMIN_ROLE_NO_EXIST = new CodeMsg(-5001,"该角色不存在！");
    public static CodeMsg ADMIN_ROLE_EDIT_ERROR = new CodeMsg(-5002,"角色编辑失败，请重试！");
    public static CodeMsg ADMIN_ROLE_DELETE_ERROR = new CodeMsg(-5003,"该角色中有关联，请逐级删除");

    //数据库备份还原错误码
    public static CodeMsg ADMIN_DATABASE_DATA_NOEXIST = new CodeMsg(-6000,"数据库备份记录不存在");

    //后台物品及分类管理错误码
    public static CodeMsg ADMIN_GOOGSCATEGORT_ADD_ERROR = new CodeMsg(-7000,"添加错误，请联系管理员");
    public static CodeMsg ADMIN_GOOGSCATEGORT_EDIT_ERROR = new CodeMsg(-7001,"编辑错误，请联系管理员");
    public static CodeMsg ADMIN_GOOGSCATEGORT_DELETE_ERROR = new CodeMsg(-7002,"该分类下存在子分类或物品分类，请逐级删除，有关联数据，");
    public static CodeMsg ADMIN_GOODS_NO_EXIST = new CodeMsg(-7003,"物品不存在");
    public static CodeMsg ADMIN_GOODS_STATUS_ERROR = new CodeMsg(-7004,"物品状态正常，请勿重复操作");
    public static CodeMsg ADMIN_GOODS_STATUS_UP_DOWN_ERROR = new CodeMsg(-7005,"物品状态修改错误，请联系管理员");
    public static CodeMsg ADMIN_GOODS_STATUS_ERROR_NOEXIST = new CodeMsg(-7006,"物品状态不存在");
    public static CodeMsg ADMIN_GOODS_STATUS_SOLDED = new CodeMsg(-7007,"商品已出售，状态不允许修改");
    public static CodeMsg ADMIN_GOOGS_DELETE_ERROR = new CodeMsg(-7008,"该物品存在举报、评论信息，不能删除，请先删除评论信息或举报信息");

    //后台学生管理
    public static CodeMsg ADMIN_STUDENT_NO_EXIST= new CodeMsg(-7100,"学生不存在");
    public static CodeMsg ADMIN_STUDENT_STATUS_NUMMBER_ERROR= new CodeMsg(-7101,"学生状态码错误");
    public static CodeMsg ADMIN_STUDENT_STATUS_EXIST= new CodeMsg(-7102,"学生状态是正常的，请勿重复操作");
    public static CodeMsg ADMIN_STUDENT_OPT_ERROR = new CodeMsg(-7103,"修改状态错误，请联系管理员");
    public static CodeMsg ADMIN_STUDENT_DELETE_ERROR = new CodeMsg(-7104,"该学生存在举报、评论信息，不能删除，请先删除评论信息或举报信息");

    //后台新闻公告
    public static CodeMsg ADMIN_NEWS_ADD_ERROR = new CodeMsg(-7200,"发布失败，请联系管理员");
    public static CodeMsg ADMIN_NEWS_EDIT_ERROR = new CodeMsg(-7201,"编辑失败，请联系管理员");

    //友情链接错误码
    public static CodeMsg ADMIN_FRIEND_URL_ADD_ERROR = new CodeMsg(-7300,"URL设置失败，请联系管理员");
    public static CodeMsg ADMIN_FRIEND_URL_EDIT_ERROR = new CodeMsg(-7301,"URL编辑失败，请联系管理员");

    //网站设置
    public static CodeMsg ADMIN_SITESETTING_EDIT_ERROR = new CodeMsg(-7400,"网站设置失败，请联系管理员");

    //前台用户注册错误码
    public static CodeMsg HOME_STUDENT_REGISTER_SN_EXIT = new CodeMsg(-8000,"该学号已经存在，请重新输入");
    public static CodeMsg HOME_STUDENT_REGISTER_ERROR = new CodeMsg(-8001,"注册失败！，请联系管理员");


    //前台用户登录错误码
    public static CodeMsg HOME_STUDENT_LOGGIN_SN_NOEXIT = new CodeMsg(-9000,"请检查学号是否正确");
    public static CodeMsg HOME_STUDENT_LOGGIN_PASSWORD_ERROR = new CodeMsg(-9001,"密码错误，请联系管理员修改密码");
    public static CodeMsg HOME_STUDENT_LOGGIN_STATUS_NOABLE = new CodeMsg(-9002,"账号被冻结，请联系管理员");

    //用户中心错误码
    public static CodeMsg HOME_STUDENT_EDITINFO_EDIT_ERROR = new CodeMsg(-100000,"基本信息修改失败，请联系管理员！");
    public static CodeMsg HOME_STUDENT_OLDPWD_EDIT_ERROR = new CodeMsg(-100001,"原密码不正确，请重新输入");
    public static CodeMsg HOME_STUDENT_NEWPWD_SIZE_ERROR = new CodeMsg(-100002,"密码长度不能小于6，请重新输入");
    public static CodeMsg HOME_STUDENT_NEWPWD_ERROR = new CodeMsg(-100003,"新密码不能与原密码相同，请重新输入");
    public static CodeMsg HOME_STUDENT_NEWPWD_RENEWPWD_ERROR = new CodeMsg(-100004,"请保证确认密码与新密码一致");
    public static CodeMsg HOME_STUDENT_PWD_EDIT_ERROR = new CodeMsg(-100005,"密码修改错误，请联系管理员");
    //前端用户发布物品错误码
    public static CodeMsg HOME_STUDENT_PUBLISH_ERROR = new CodeMsg(-200000,"物品发布失败，请联系管理员");
    public static CodeMsg HOME_STUDENT_PUBLISH_CATEGROY_EMPTY = new CodeMsg(-200001,"请选择物品分类！");
    public static CodeMsg HOME_STUDENT_PUBLISH_BUYPRICE_ERROR= new CodeMsg(-200002,"购入价格错误！");
    public static CodeMsg HOME_STUDENT_PUBLISH_SELLPRICE_ERROR = new CodeMsg(-200003,"出售价格错误！");
    public static CodeMsg HOME_STUDENT_PUBLISH_EDIT_ERROR = new CodeMsg(-200004,"物品编辑失败，请联系管理员！");
    public static CodeMsg HOME_STUDENT_PUBLISH_EDIT_EMPTY = new CodeMsg(-200005,"物品不存在，请重试！");
    //前端用户期望物品错误码
    public static CodeMsg HOME_STUDENT_PUBLISH_WANTED_ERROR= new CodeMsg(-200006,"期望价格错误！");

    //前端用户举报错误码
    public static CodeMsg HOME_STUDENT_REPORT_GOODS_ERROR = new CodeMsg(-300000,"举报失败，请联系管理员");
    public static CodeMsg HOME_STUDENT_REPORTED_GOODS_ERROR = new CodeMsg(-300001,"你已经举报过该物品，请勿重复举报");
    public static CodeMsg HOME_STUDENT_REPORTED_NO_STUDENT = new CodeMsg(-300002,"请先登录后，再举报");
    public static CodeMsg HOME_STUDENT_REPORTED_NO_EXIST = new CodeMsg(-300003,"举报信息不存在！");

    //前端用户评论错误码
    public static CodeMsg HOME_STUDENT_COMMENT_NO_EXIST = new CodeMsg(-400000,"评论物品不存在！");
    public static CodeMsg HOME_STUDENT_COMMENT_ERROR = new CodeMsg(-400001,"评论失败，请联系管理员");
}
